/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 九转苍翎
 * Date: 2025/9/2
 * Time: 20:53
 */
public class Solution {
    public int getSum(int a, int b) {
        while (b != 0) {
            int x = a ^ b;//计算无进位相加的结果
            int y = (a & b) << 1;//计算进位
            a = x;
            b = y;
        }
        return a;
    }
    public static void main(String[] args) {
        Solution solution = new Solution();
        int sum = solution.getSum(1, 2);
        System.out.println(sum);
    }
}